package com.mc.lp.database.entity.type;
/*
 * @author aphanda
 * @date Mar 8, 2015
 * @time 11:51:25 PM
 */

public enum StrengthWeaknessType {

	STRENGTH(7), WEAKNESS(3),NONE(0);

	int minimumWeightage;

	private StrengthWeaknessType(int minimumWeight) {
		this.minimumWeightage = minimumWeight;
	}

	public int getMinimumWeightage() {
		return minimumWeightage;
	}

	public void setMinimumWeightage(int minimumWeightage) {
		this.minimumWeightage = minimumWeightage;
	}
	
	
	public static StrengthWeaknessType getTypeByWeigtage(int weightage){
		
		if(weightage>=StrengthWeaknessType.STRENGTH.getMinimumWeightage()){
			return StrengthWeaknessType.STRENGTH;
		}else if(weightage<=StrengthWeaknessType.WEAKNESS.getMinimumWeightage()){
			return StrengthWeaknessType.WEAKNESS;
		}else{
			return StrengthWeaknessType.NONE;
		}
	}

}
